""" User configuration file for IPython

This is a more flexible and safe way to configure ipython than *rc files
(ipythonrc, ipythonrc-pysh etc.)

This file is always imported on ipython startup. You can import the
ipython extensions you need here (see IPython/Extensions directory).

Feel free to edit this file to customize your ipython experience.

Note that as such this file does nothing, for backwards compatibility.
Consult e.g. file 'ipy_profile_sh.py' for an example of the things 
you can do here.

See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
description on what you could do here.
"""


import IPython.ipapi
# create the main configuration object
ip = IPython.ipapi.get()

import ipy_defaults

def main():   
    import os
    import sys
    import readline
    import ipy_profile_sh
    # allow the use of %tasks and %kill
    import jobctrl
    # allow the autoreloading of modules (%autoreload, %aimport)
    import ipy_autoreload
    
    o = ip.options

    o.autocall        = False
    o.autoedit_syntax = True
    o.autoindent      = True
    o.automagic       = True
    o.banner          = False
    o.system_verbose  = False
    o.confirm_exit    = False

    # setup prompt
    o.prompt_in1    = "[\#] >>> "
    o.prompt_in2    = "   .\D.: "
    o.prompt_out    = "[\#]   : "
    o.separate_out  = ""
    o.separate_out2 = ""



# some config helper functions you can use 
def import_all(modules):
    """ Usage: import_all("os sys") """ 
    for m in modules.split():
        ip.ex("from %s import *" % m)

def execf(fname):
    """ Execute a file in user namespace """
    ip.ex('execfile("%s")' % os.path.expanduser(fname))

main()
